﻿@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Defaults.cshtml";
}
<style>
	p {
		font-size: 22px;
		font-weight: bold;
		font-style: italic;
		color: rgb(62, 62, 62);
		margin: 18px;
	}
	#section ul {
		float: left;
		border-radius: 5px;
		border: solid 1px rgb(198, 198, 198);
		padding: 7px 11px;
		background-color: rgb(248,248,248);
	}
	#section li {
		float: left;
		background-color: rgb(200,200,200);
		padding: 5px 19px;
		margin: 5px 2px 5px 0px;
		color: black;
		list-style: none;
	}
	#section li:hover,#section li:hover a {
		background-color: rgb(6,179,6);
		color:white;
	}
	#section li a {
		text-decoration: none;
		color: white;
		font-size: 21px;
		font-style: italic;
		text-shadow: 1px 0px 3px rgb(157, 157, 157);
	}
	#section li:nth-child(1) { border-radius: 4px 0px 0px 4px; margin-left: 1px;}
	#section li:nth-child(4) { border-radius: 0px 4px 4px 0px;}
	#section .active {
		background-color: rgb(6,179,6);
	}
    h3 {
        clear:both;
    }
    #section .form-horizontal{
        clear:both;
    }
	</style>

<div ng-app="app" ng-controller="DemoCtrl">                
    <div class="search">
        Tìm : <input type="text" ng-model="search.$" />
    </div>
      <a class="btn btn-info" ng-click="appDialog(false,null)">
										<i class="glyphicon glyphicon-plus icon-white"></i>  
										Thêm mới                                           
	</a>
    
    

    <table class="table table-striped table-bordered bootstrap-datatable datatable">
            <tr>
                <th>
                    <a href="#" ng-click="orderByField='iD'; reverseSort = !reverseSort">
                       Mã nhân viên <span ng-show="orderByField == 'iD'"><span ng-show="!reverseSort">^</span><span ng-show="reverseSort">v</span></span>
                    </a>
                </th>
                <th>
                     <a href="#" ng-click="orderByField='hONV'; reverseSort = !reverseSort">
                        Họ và tên đệm <span ng-show="orderByField == 'hONV'"><span ng-show="!reverseSort">^</span><span ng-show="reverseSort">v</span></span>
                    </a>
                </th>
                <th>
                     <a href="#" ng-click="orderByField='tENNV'; reverseSort = !reverseSort">
                        Tên <span ng-show="orderByField == 'tENNV'"><span ng-show="!reverseSort">^</span><span ng-show="reverseSort">v</span></span>
                    </a>
                </th>
                <th>
                     <a href="#" ng-click="orderByField='nGAYSINH'; reverseSort = !reverseSort">
                       Ngày sinh <span ng-show="orderByField == 'nGAYSINH'"><span ng-show="!reverseSort">^</span><span ng-show="reverseSort">v</span></span>
                    </a>
                </th>
                <th>
                    <a href="#" ng-click="orderByField='nGAYSINH'; reverseSort = !reverseSort">
                       Địa chỉ <span ng-show="orderByField == 'nGAYSINH'"><span ng-show="!reverseSort">^</span><span ng-show="reverseSort">v</span></span>
                    </a>
                </th>    
                <th></th>
            </tr>
            <tr ng-repeat="nv in nhanviens |orderBy:orderByField:reverseSort  | filter:search">
                <td> {{nv.iD}}</td>
                <td> {{nv.hONV | uppercase}}</td>
                <td> {{nv.tENNV | uppercase}}</td>
                <td> {{nv.nGAYSINH | date :'dd-MM-yyyy'}}</td>
                <td> {{nv.dIACHIFULL}}</td>      
                <td class="center">
                    <a class="btn btn-success" ng-click="detail(nv)">
										<i class="icon-zoom-in icon-white"></i>  
										Thông tin                                            
                    </a>
                    
                     <div ng-show="showEdit()">
                                <a class="btn btn-info" ng-click="appDialog(true,nv)">
										<i class="icon-edit icon-white"></i>  
										Sửa                                            
									</a>
                            </div>
                                <div ng-show="showDelete()">
									<a class="btn btn-danger" ng-click="delete(nv.iD)">
										<i class="icon-trash icon-white"></i> 
										Xóa
									</a>
                             </div>

                </td>               
            </tr>
     </table>

     <pagination total-items="totalItems" ng-model="currentPage" max-size="maxSize" class="pagination" boundary-links="true" rotate="false" num-pages="numPages"></pagination>

        <div ng-controller="DialogCtrl">
            <jqdialog dialog-name="App" title="'Nhân viên'"
                      auto-open="false" width="980" height="600"
                      on-open="onOpen" buttons="{'Lưu': onOk, 'Hủy': onCancel, 'Đóng': 'close' }"
                      args-to-scope="true"
                      before-close="beforeClose">
               <section id="section">
		        <ul ng-init="tab = 1">
			        <li ng-class="{active:tab===1}"> 
				        <a href ng-click="tab = 1">Thông tin chung</a>	
			        </li>
			        <li ng-class="{active:tab===2}"> 
				        <a href ng-click="tab = 2">Thông tin nhân viên</a> 
			        </li>
			        <li ng-class="{active:tab===3}"> 
				        <a href ng-click="tab = 3">Trình độ nhân viên</a> 
			        </li>
                    <li ng-class="{active:tab===4}"> 
				        <a href ng-click="tab = 4">Thành phần gia đình</a> 
			        </li>
			        <br><br>
			        <div ng-show="tab === 1"> 
                        
                        <form class="form-horizontal">
                            <fieldset>
                                    <div class="form-group">
                                      <label class="col-sm-2 control-label">Họ :</label>
                                      <div class="col-sm-10">
                                        <input type="text" ng-model="nv.hONV"  placeholder="Họ và tên đệm">
                                      </div>
                                    </div> 
                                    <div class="form-group">
                                      <label class="col-sm-2 control-label">Tên:</label>
                                      <div class="col-sm-10">
                                        <input type="text" ng-model="nv.tENNV"  placeholder="Tên">
                                      </div>
                                    </div>
                                    <div class="form-group">
                                      <label class="col-sm-2 control-label">Giới tính:</label>
                                      <div class="col-sm-10">
                                        <input type="checkbox" ng-model="nv.pHAI"  placeholder="Tên">
                                      </div>
                                    </div>

                                    <div class="form-group">
                                      <label class="col-sm-2 control-label">Ngày sinh :</label>
                                      <div class="col-sm-10">
                                        <input type="date" name="input" ng-model="value"  placeholder="dd-MM-yyyy"
                                            min="1100-01-01" max="2199-12-31" required/>
                                      </div>
                                    </div>

                                   <div class="form-group">
                                      <label class="col-sm-2 control-label">Ngày :</label>
                                       <div class="col-sm-2">
                                           <input type="number" id="ngay" />
                                       </div>
                                       <label class="col-sm-1 control-label">Tháng :</label>
                                       <div class="col-sm-1">
                                           <input type="number" id="thang" />
                                       </div>
                                       <label class="col-sm-2 control-label">Năm :</label>
                                       <div class="col-sm-1">
                                           <input type="number" id="nam" />
                                       </div>
                                    </div>

                                    <div class="form-group">
                                      <label class="col-sm-2 control-label">Nơi sinh :</label>
                                      <div class="col-sm-10">
                                        <input type="text" ng-model="nv.nOISINH"  placeholder="Nơi sinh">
                                      </div>
                                      
                                    </div>
                                </fieldset>
                         </form>
			        </div>
			        <div ng-show="tab === 2"> <h3>Thông tin nhân viên</h3>
                         <form class="form-horizontal">
                              <div class="form-group">
                                  <label class="col-sm-2 control-label">Thánh danh:</label>
                                  <div class="col-sm-10">
                                    <input type="text" ng-model="nv.tHANHDANH"  placeholder="Nơi sinh">
                                  </div>
                              </div>
                              <div class="form-group">
                                  <label class="col-sm-2 control-label">Số Nhà:</label>
                                  <div class="col-sm-10">
                                    <input type="text" ng-model="nv.dIACHI"  placeholder="Địa chỉ">
                                  </div>
                                 
                             </div>
                             <div class="form-group">
                                 <label class="col-sm-2 control-label">Tỉnh/tp:</label>
                                 <div class="col-sm-10">
                                     <select ng-model="nv.tinhId">
                                         <option ng-repeat="_tinh in tinhs" value="{{_tinh.id}}">{{_tinh.tentinh}}</option>
                                     </select>
                                 </div>
                             </div>
                             <div class="form-group">
                                 <label class="col-sm-2 control-label">Quận/Huyện:</label>
                                 <div class="col-sm-10">
                                     <select ng-model="nv.quanId">
                                         <option ng-repeat="_quan in quans" value="{{_quan.id}}">{{_quan.tenQH}}</option>
                                     </select>
                                 </div>
                             </div>
                              <div class="form-group">
                                  <label class="col-sm-2 control-label">Nghề nghiệp:</label>
                                  <div class="col-sm-10">
                                    <input type="text" ng-model="nv.nGHENGHIEP"  placeholder="Nghề nghiệp">
                                  </div>
                             </div>
                              <div class="form-group">
                                  <label class="col-sm-2 control-label">Số điện thoại:</label>
                                  <div class="col-sm-10">
                                    <input type="text" ng-model="nv.sODIENTHOAI"  placeholder="Số điện thoại">
                                  </div>
                             </div>
                              <div class="form-group">
                                  <label class="col-sm-2 control-label">Nhập môn:</label>
                                  <div class="col-sm-10">
                                    <input type="text" ng-model="nv.nHAPMON"  placeholder="Nhập môn">
                                  </div>
                             </div>
                             <div class="form-group">
                                  <label class="col-sm-2 control-label">Nhập môn 2:</label>
                                  <div class="col-sm-10">
                                    <input type="text" ng-model="nv.nHAPMON2"  placeholder="Nhập môn 2">
                                  </div>
                             </div>
                             <div class="form-group">
                                  <label class="col-sm-2 control-label">Năm vào cơ quan:</label>
                                  <div class="col-sm-10">
                                    <input type="text" ng-model="nv.nHAPMON2"  placeholder="Nhập môn 2">
                                  </div>
                             </div>
                         </form>

			        </div>
			        <div ng-show="tab === 3"> <h3>Trình độ văn hóa</h3>
                        <form class="form-horizontal">
                            <div class="form-group">
                                  <label class="col-sm-2 control-label">Lúc trai:</label>
                                  <div class="col-sm-10">
                                    <input type="text" ng-model="nv.lUCTRAI"  placeholder="Lúc trai">
                                  </div>
                             </div>
                             <div class="form-group">
                                  <label class="col-sm-2 control-label">Chuyên môn:</label>
                                  <div class="col-sm-10">
                                    <input type="text" ng-model="nv.cHUYENMON"  placeholder="Chuyên môn">
                                  </div>
                             </div>
                             <div class="form-group">
                                  <label class="col-sm-2 control-label">Thánh giáo một:</label>
                                  <div class="col-sm-10">
                                    <input type="text" ng-model="nv.tHANHGIAO1"  placeholder="Thánh giáo một">
                                  </div>
                             </div>
                            <div class="form-group">
                                  <label class="col-sm-2 control-label">Thánh giáo hai:</label>
                                  <div class="col-sm-10">
                                    <input type="text" ng-model="nv.tHANHGIAO2"  placeholder="Thánh giáo hai">
                                  </div>
                             </div>
                             <div class="form-group">
                                  <label class="col-sm-2 control-label">Thánh giáo ba:</label>
                                  <div class="col-sm-10">
                                    <input type="text" ng-model="nv.tHANHGIAO3"  placeholder="Thánh giáo ba">
                                  </div>
                             </div>
                               <div class="form-group">
                                  <label class="col-sm-2 control-label">Trình độ :</label>
                                  <div class="col-sm-10">
                                        <select ng-model="nv.tDID" >
                                            <option ng-repeat="item in trinhdos" value="{{item.iD}}">{{item.tENTD}}</option>
                                        </select>
                                  </div>
                             </div>
                            <div class="form-group">
                                  <label class="col-sm-2 control-label">Vũ :</label>
                                  <div class="col-sm-10">
                                        <select ng-model="nv.vUID" >
                                            <option ng-repeat="item in vus" value="{{item.iD}}">{{item.tENVU}}</option>
                                        </select>
                                  </div>
                             </div>
                        </form>

			        </div>
                    <div ng-show="tab === 4"> Thành phần gia đình</div>
		        </ul>
                   		
	        </section>		
            </jqdialog>
        </div>

 </div>
<script src="~/Content/lib/jquery-1.8.3.js"></script>
<script src="~/Content/lib/jquery-ui.js"></script>
<script src="~/Content/lib/angular.js"></script>
<script src="~/Content/lib/module.js"></script>
<script src="~/Content/js/jqdialog/jqdialog.js"></script>
<script src="~/Content/md/nv/nv.js"></script>
<script>
    $("#dscv").html("Danh Sách Nhân Viên");
</script>
